<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:99:"/Users/doyi/project/east_environmental/public/../application/admin/view/Userorder/order_detail.html";i:1547708171;s:78:"/Users/doyi/project/east_environmental/application/admin/view/common/head.html";i:1546106095;s:80:"/Users/doyi/project/east_environmental/application/admin/view/common/footer.html";i:1546106095;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>东方环保</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/build/css/app.css" media="all">
</head>
<style>
    .hidden{
        display: none;
    }

</style>
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;height: 750px">
    <blockquote class="layui-elem-quote layui-text">
        <div class="layui-row">
            <div class="layui-col-md4">
                <div class="grid-demo grid-demo-bg1">
                    <div class="layui-col-md3">
                        <div class="grid-demo grid-demo-bg1">订单编号 ：</div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="grid-demo"><?php echo (isset($info['order_num'] ) && ($info['order_num']  !== '')?$info['order_num'] :''); ?></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md4">
                <div class="grid-demo">
                    <div class="layui-col-md3">
                        <div class="grid-demo grid-demo-bg1">订单状态 ：</div>
                    </div>
                    <div class="layui-col-md3">
                        <?php if(($info['status'] == 1)): ?>
                        <div class="grid-demo">下单</div>
                        <?php endif; if(($info['status'] == 2)): ?>
                        <div class="grid-demo">已下单</div>
                        <?php endif; if(($info['status'] == 3)): ?>
                        <div class="grid-demo">完成</div>
                        <?php endif; if(($info['status'] == 4)): ?>
                        <div class="grid-demo">待反馈</div>
                        <?php endif; if(($info['status'] == 5)): ?>
                        <div class="grid-demo">已谢绝</div>
                        <?php endif; ?>
                    </div>

                </div>
            </div>
            <div class="layui-col-md4">
                <div class="grid-demo grid-demo-bg1">

                    <div class="layui-col-md4">
                        <div class="grid-demo grid-demo-bg1">创建日期 ：</div>
                    </div>
                    <div class="layui-col-md8">
                        <div class="grid-demo"><?php echo (isset($info['add_time'] ) && ($info['add_time']  !== '')?$info['add_time'] :''); ?></div>
                    </div>

                </div>
            </div>
        </div>
    </blockquote>

    <blockquote class="layui-elem-quote layui-text">
    <div class="layui-card">
        <div class="layui-card-header">订单详情</div>
        <div class="layui-card-body">
           <?php if(($info['cate_id'] != 3 && $info['cate_id'] != 5)): ?>
                <p> 分类名称  <?php echo (isset($info['cate_name'] ) && ($info['cate_name']  !== '')?$info['cate_name'] :''); ?></p>
                <p> 项目名称   <?php echo (isset($info['project_name'] ) && ($info['project_name']  !== '')?$info['project_name'] :''); ?></p>
                <p> 地址 <?php echo (isset($info['province'] ) && ($info['province']  !== '')?$info['province'] :''); ?><?php echo (isset($info['city'] ) && ($info['city']  !== '')?$info['city'] :''); ?><?php echo (isset($info['area'] ) && ($info['area']  !== '')?$info['area'] :''); ?><?php echo (isset($info['address'] ) && ($info['address']  !== '')?$info['address'] :''); ?></p>
            <?php endif; if(($info['cate_id'] == 3 )): ?>
                <p> 分类名称  <?php echo (isset($info['cate_name'] ) && ($info['cate_name']  !== '')?$info['cate_name'] :''); ?></p>
                <p> 地址 <?php echo (isset($info['province'] ) && ($info['province']  !== '')?$info['province'] :''); ?><?php echo (isset($info['city'] ) && ($info['city']  !== '')?$info['city'] :''); ?><?php echo (isset($info['area'] ) && ($info['area']  !== '')?$info['area'] :''); ?><?php echo (isset($info['address'] ) && ($info['address']  !== '')?$info['address'] :''); ?></p>
            <?php endif; if(($info['status'] > 1 )): ?>
                <p> 接单公司  <?php echo (isset($info['user_name'] ) && ($info['user_name']  !== '')?$info['user_name'] :''); ?></p>
                <p> 接单价格  <?php echo (isset($info['price'] ) && ($info['price']  !== '')?$info['price'] :''); ?></p>
                <p> 接单时间  <?php echo (isset($info['accept_time'] ) && ($info['accept_time']  !== '')?$info['accept_time'] :''); ?></p>
            <?php endif; if(($info['cate_id'] == 5 )): ?>
            <p> 分类名称    <span style="margin-left: 5px;">:</span>   <?php echo (isset($info['cate_name'] ) && ($info['cate_name']  !== '')?$info['cate_name'] :''); ?></p>
            <p> 固废分类    <span style="margin-left: 5px;">:</span>   <?php if(($info['solid_type'] == 1)): ?> 一般分类<?php endif; if(($info['solid_type'] == 2)): ?>危险分类<?php endif; ?></p>
            <p> 固废状态    <span style="margin-left: 5px;">:</span>   <?php if(($info['solid_status'] == 1)): ?> 固体<?php endif; if(($info['solid_status'] == 2)): ?>液体<?php endif; if(($info['solid_status'] == 3)): ?>半固半液<?php endif; if(($info['solid_status'] == 4)): ?>气体<?php endif; ?></p>
            <p> 固废单位    <span style="margin-left: 5px;">:</span>   <?php echo (isset($info['solid_num'] ) && ($info['solid_num']  !== '')?$info['solid_num'] :''); ?> 吨</p>
            <p> 始发地     <span style="margin-left: 5px;">:</span>   <?php echo (isset($info['send_address'] ) && ($info['send_address']  !== '')?$info['send_address'] :''); ?></p>
            <p> 目的地     <span style="margin-left: 5px;">:</span>   <?php echo (isset($info['end_address'] ) && ($info['end_address']  !== '')?$info['end_address'] :''); ?></p>
            <p> 地址      <span style="margin-left: 5px;">:</span>    <?php echo (isset($info['province'] ) && ($info['province']  !== '')?$info['province'] :''); ?><?php echo (isset($info['city'] ) && ($info['city']  !== '')?$info['city'] :''); ?><?php echo (isset($info['area'] ) && ($info['area']  !== '')?$info['area'] :''); ?><?php echo (isset($info['address'] ) && ($info['address']  !== '')?$info['address'] :''); ?></p>
            <p> 固废描述    <span style="margin-left: 5px;">:</span>   <?php echo (isset($info['desc'] ) && ($info['desc']  !== '')?$info['desc'] :''); ?></p>
            <?php endif; ?>
        </div>
    </div>

    <?php if(($code)): ?>
    <table class="layui-table">
        <colgroup>
            <col width="10">
            <col width="20">
            <col width="20">
        </colgroup>
        <thead>
        <tr>
            <th>分类名称 </th>
            <th>业务名称</th>
            <th>固废编码</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($code as $k =>$v): ?>
        <tr>
            <td><?php echo $v['cate_class']; ?></td>
            <td><?php echo $v['resource']; ?></td>
            <td><?php echo $v['code']; ?></td>
        </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <?php endif; ?>

    </blockquote>


    <div class="layui-form" action="" method="post">
        <input type="hidden" id="id" value="<?php echo $info['id']; ?>">
        <?php if(($info['status'] == 1)): ?>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">选择厂商</label>
                <div class="layui-input-inline">
                    <select name="accept_company_id" lay-verify="required" lay-search="">
                        <option value="">直接选择或搜索选择</option>
                        <?php foreach($company as $k=>$v): ?>
                        <option value="<?php echo $v['id']; ?>"><?php echo $v['company_name']; ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">项目价格</label>
                <div class="layui-input-inline">
                    <input type="number" name="price"  autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
            </div>
        </div>

        <?php endif; ?>



    </div>


</div>
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/common/js/jquery.min.js"></script>
<script>
//    图片放大显示
    $('.select_img').on('click',function () {
        var img_url=$(this).data('content');
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            area: ['50%','80%'],
            skin: 'layui-layer-nobg', //没有背景色
            shadeClose: true,
            content: '<img src="'+img_url+'" />',
        });
    })
    //文件上传
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //多文件列表示例
        var demoListView = $('#demoList')
            ,uploadListIns = upload.render({
            elem: '#testList'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,accept: 'file'
            ,multiple: true
            ,auto: false
            ,bindAction: '#testListAction'
            ,choose: function(obj){
                var files = obj.pushFile(); //将每次选择的文件追加到文件队列
                //读取本地文件
                obj.preview(function(index, file, result){
                    var tr = $(['<tr id="upload-'+ index +'">'
                        ,'<td>'+ file.name +'</td>'
                        ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
                        ,'<td>等待上传</td>'
                        ,'<td>'
                        ,'<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
                        ,'<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete">删除</button>'
                        ,'</td>'
                        ,'</tr>'].join(''));

                    //单个重传
                    tr.find('.demo-reload').on('click', function(){
                        obj.upload(index, file);
                    });

                    //删除
                    tr.find('.demo-delete').on('click', function(){
                        delete files[index]; //删除对应的文件
                        tr.remove();
                    });

                    demoListView.append(tr);
                });
            }
            ,done: function(res, index, upload){
                if(res.code == 200){ //上传成功
                    var tr = demoListView.find('tr#upload-'+ index)
                        ,tds = tr.children();
                    tds.eq(2).html('<span style="color: #5FB878;">上传成功</span><input type="hidden" name="images['+index+']" value="'+res.data.src+'">');
                    tds.eq(3).html(''); //清空操作
                    delete files[index]; //删除文件队列已经上传成功的文件
                    return;
                }
                this.error(index, upload);
            }
            ,error: function(index, upload){
                var tr = demoListView.find('tr#upload-'+ index)
                    ,tds = tr.children();
                tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
                tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
            }
        });

        //普通图片上传 单图片上传
        var uploadInst = upload.render({
            elem: '#image'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#show_image').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code == 400){
                    return layer.msg('上传失败');
                }
                $('.value_image').val(res.data.src);
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>


<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('demo');

        //自定义验证规则
        form.verify({
            pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });



        //监听提交
        form.on('submit(demo1)', function(data){
            var id = $('#id').val();
            data.field['id'] = id;
            $.ajax({
                url: '<?php echo url("Userorder/save_order"); ?>',
                type: 'post',
                dataType: 'json',
                data: data.field,
                success: function (obj) {
                    if(obj.code==200){
                        parent.layer.msg(obj.msg, {icon: 6,time: 1000});
                        //当你在iframe页面关闭自身时
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index,data.field); //再执行关闭
                    }
                    if(obj.code==400){
                        layer.msg(obj.msg, {icon: 5,time: 1000});
                    }
                },
                error:function(data){
                    console.log(data);
                }
            });

        });


    });
</script>

</body>
</html>